package main

import (
	"fmt"
	"net"
	"strconv"
	"time"
)

func main() {

	addr, _ := net.ResolveTCPAddr("tcp4", "localhost:8090")

	for i := 0; i < 5; i++ {
		time.Sleep(1 * time.Second)

		conn, _ := net.DialTCP("tcp4", nil, addr)
		conn.Write([]byte("客户端发送消息" + strconv.Itoa(i)))

		b := make([]byte, 1024)
		count, _ := conn.Read(b)

		fmt.Println("服务端返回：", string(b[:count]))
		conn.Close()
	}
}
